<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

<link type="text/css" rel="stylesheet" href="t2v.css">


<!-- Place this tag in the <head> of your document -->
<script type="text/javascript">
	window.___gcfg = {
		lang : 'en'
	};
	(function() {
		var po = document.createElement("script");
		po.type = "text/javascript";
		po.async = true;
		po.src = "https://apis.google.com/js/plusone.js";
		var s = document.getElementsByTagName("script")[0];
		s.parentNode.insertBefore(po, s);
	})();
</script>
<script type="text/JavaScript"
	src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
	
</script>

<script src="http://malsup.github.com/jquery.form.js"></script>

<script type="text/javascript">
	var urlText;
	function lookupURL(url) {

		$.ajax({
			type : "POST",
			url : "urlservice",
			cache : false,
			data : "u=" + url,
			success : function(data, textStatus, jqXHR) {
				viz(url, data);
			},
			error : function(jqXHR, textStatus, errorThrown) {
				alert("error " + textStatus);
			}
		});
	}
</script>

<script type="text/javascript">
	function lookupTwit(twq) {

		$.ajax({
			type : "POST",
			url : "twitservice",
			cache : false,
			data : "q=" + twq,
			success : function(data, textStatus, jqXHR) {
				viz("Twitter Query: " + twq, data);
			},
			error : function(jqXHR, textStatus, errorThrown) {
				alert("error " + textStatus);
			}
		});
	}
</script>

<title>txt2viz: Text to Viz by Laurie Hirsch</title>
</head>
<body>
	<p>
	<h1>
		<em style="font-size: 48px"><b> <span style="color: blue">t</span><span
				style="color: cyan">xt</span><span style="color: purple">2</span><span
				style="color: cyan">vz</span></b></em>: <span
			style="font-family: arial; font-size: 17px;">Visualise your
			Documents.</span>
	</h1>
	<form id="myForm2" action="uploadservice" method="post"
		enctype="multipart/form-data">

		<input type="file" id="postedFile" name="postedFile" /> <input
			type="submit" value="Viz selected file" />
	</form>
	<br>


	<script src="http://www.java.com/js/deployJava.js"></script>
	<script>
		var attributes = {
			id : 't2v',
			code : 'wviz.T2vPrefuseApplet',
			width : 900,
			height : 700
		};
		var parameters = {
			jnlp_href : 't2vLocal.jnlp',
			draggable : 'true',
			java_decorated_frame : 'true',
			java_applet_title : 'txt2vz'
		};
		deployJava.runApplet(attributes, parameters, '1.6');
	</script>

	<ol>
		<li>once your visualization appears you can <i>zoom</i> in or out
			by holding the right click of your mouse and moving up or down.
		</li>
		<li>change how your graph looks with the control panel</li>
		<li>drag txt2vz out of your browser using the Alt key and left
			mouse</li>
	</ol>

	<script language="javascript">
		function vizText() {

			t2v.getTextFromJavaScript("pasted text", document
					.getElementById('txt1').value);
		}

		function viz(filename, data) {
			//alert("data " + data);
			t2v.getTextFromJavaScript(filename, data);
		};
	</script>


	<script type="text/javascript">
		// prepare the form when the DOM is ready 
		$(document).ready(function() {

			var options = {
				success : function(data, textStatus, jqXHR) {
					var fname = $('input[type=file]').val().split('\\').pop();
					viz(fname, data);
				},
				error : function(jqXHR, textStatus, errorThrown) {
					alert("error " + textStatus);
				}
			};

			// bind to the form's submit event 
			$('#myForm2').submit(function() {
				// inside event callbacks 'this' is the DOM element so we first 
				// wrap it in a jQuery object and then invoke ajaxSubmit 
				$(this).ajaxSubmit(options);

				// !!! Important !!! 
				// always return false to prevent standard browser submit and page navigation 
				return false;
			});
		});
	</script>


	<p>Type in your Twitter Query or Hashtag:</p>
	<form name=frm1 action="javascript: lookupTwit(twitQ.value)">
		<input type="text" name="twitQ" id="twitQ" size=40> <input
			type="button" value="viz Twitter" onclick="lookupTwit(twitQ.value)">
	</form>

	<p>Type/paste text into the box below:</p>

	<textarea name="txt1" id="txt1" COLS=40 ROWS=5></textarea>

	<input type="button" value="viz text" onclick="vizText()">

	<p>
		Enter the <b>URL</b> of a web site:
	</p>

	<input type="text" id="url2"
		value="http://en.wikipedia.org/wiki/Tag_cloud" size=40>

	<button onclick="lookupURL(url2.value)">viz URL</button>
	<br />
	<br />

	<hr />


	<p style="font-family: arial; font-size: 14px;">
		If you like txt2vz but feel you would like something more challenging
		perhaps you should read my book : <a
			href="http://www.lulu.com/content/paperback-book/sleepy-cat-monkey/1316134"
			target="_blank"> <em>Sleepy Cat Monkey </em></a>
	</p>
	<p>
		<a
			href="http://www.lulu.com/content/paperback-book/sleepy-cat-monkey/1316134"
			target="_blank"> <img border="0" src="sleepyCatMonkey.jpg"
			alt="Sleepy Cat Monkey" width="280" height="380" align="right" />
		</a>
	</p>

	<p>
		Thanks to the magnificent <b>Hadi Afshar</b>, some great ideas and
		programming help especially around stemming.
	</p>

	<p>Any comments, observations or suggestions for improvement
		appreciated:</p>
	<p>

		<!-- Place this tag where you want the badge to render -->
		<g:plus href="https://plus.google.com/117816592489907408686"
			rel="publisher" width="300" height="131" theme="light"></g:plus>
	</p>
	<p>

		<!--  or twitter <a href=https://twitter.com/txt2vz> txt2vz twitter</a>-->
	</p>
	<div style="font-family: arial; font-size: 8px;">
		<span style="font-size: 18px"> <span style="color: blue">t</span><span
			style="color: cyan">xt</span><span style="color: purple">2</span><span
			style="color: cyan">vz</span></span>: is powered by:
		<ol>
			<li><a href=http://lucene.apache.org> Apache Lucene</a></li>
			<li><a href=http://tika.apache.org> Apache Tika</a></li>
			<li><a href=http://prefuse.org> Prefuse</a></li>
			<li><a
				href=http://faculty.uoit.ca/collins/research/docuburst/index.html />Docuburst</a>
			</li>
		</ol>
		Note: txt2vz is currently only available in English.  txt2vz has been tested on Chrome and IE9

	</div>

	<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37171770-2']);
  _gaq.push(['_setDomainName', 'eu01.aws.af.cm']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
</body>
</html>
